<?php
/*!
 * Theme Name:One Nav
 * Theme URI:https://www.iotheme.cn/
 * Author:iowen
 * Author URI:https://www.iowen.cn/
 */
if ( ! defined( 'ABSPATH' ) ) { exit; }

// 如果开启的防水墙后进不了后台，将下面的 true 改为 false
// ------------------------------------------------------------------------------------
define ('LOGIN_007', true );


//date_default_timezone_set('Asia/Shanghai');
require get_theme_file_path('/inc/theme-start.php'); 


//使用七牛CDN，重写主题路径
function QiNiuCDN(){
    function Rewrite_URI($html){
        $pattern ='/https:\/\/(www\.|)8kmm\.com\/wp-([^"\']*?)\.(jpg|js|css|gif|png|jpeg|woff|svg)/i';
        $replacement = 'https://img.8kmm.com/wp-$2.$3';
    $html = preg_replace($pattern, $replacement,$html);
    return $html;
    }
    if(!is_admin()){
        ob_start("Rewrite_URI");
    }
}
//add_action('init', 'QiNiuCDN');